<template>
  <view class="anim-wrapper" :style="{ width: width + 'rpx', height: height + 'rpx' }">
    <view class="scale-view" :style="{ transform: `scale(${scale})` }">
      <slot></slot>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    width: {
      type: Number
    },
    height: {
      type: Number
    }
  },
  data () {
    return {
      scale: uni.upx2px(this.width) / this.width
    }
  }
}
</script>

<style lang="less" scoped>
.anim-wrapper {
  .scale-view {
    transform-origin: 0% 0%;
  }
}
</style>
